
import { defineStore } from 'pinia'
//创建用户小仓库
const useUserStore = defineStore('User',{
	state:()=>{
		return {
			token: uni.getStorageSync('token') || '',
		}
	},
	actions: {
		// 添加token
		updateToken(token: string) {
			uni.setStorageSync('token', token);
			this.token = token
		}
	}
})

export default useUserStore